package org.example.controller;

import org.example.common.RestMap;
import org.example.common.RestMapUtils;
import org.example.entity.AuthUserEntity;
import org.example.entity.UserEntity;
import org.example.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private IUserService service;
    @PostMapping("/selectList")
    public RestMap selectList(@RequestBody UserEntity entity){
        Map<String,Object> map = new HashMap<>();
        map.put("count",service.selectCount(entity));
        map.put("data",service.selectList(entity,null));
        return RestMapUtils.success(map);
    }
}
